package method_replacement;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.support.MethodReplacer;

import java.lang.reflect.Method;

/**
 * @author wx-li
 * @company 希睿科技(www.xraitech.com)
 * @copyright (c) 2018 希睿科技( www.xraitech.com )Inc. All rights reserved.
 * @date 2020/10/16 17:56
 * @since JDK1.8
 */
public class FXNewsProviderMethodReplacer implements MethodReplacer {
    private static final transient Log logger =
            LogFactory.getLog(FXNewsProviderMethodReplacer.class);

    @Override
    public Object reimplement(Object obj, Method method, Object[] args) throws Throwable {
        logger.info("before executing method[" + method.getName() + "] on Object["
        + obj.getClass().getName() + "].");
        System.out.println("sorry, We will do noting this time.");
        logger.info("end of executing method[" + method.getName() + "] on Object["
                + obj.getClass().getName() + "].");
        return null;
    }
}
